package com.wbp.cms.core.customer.dao;

import java.util.List;

import org.springframework.stereotype.Repository;

import com.wbp.cms.client.customer.domain.MessageDO;
import com.wbp.cms.client.customer.query.MessageQuery;
import com.wbp.cms.core.dao.BaseDao;

/**
 * @Description: 
 * @Department:
 * @author andy.lhc
 * @date 2016年3月20日 上午11:14:46 
 */
@Repository("messageDAO")
public class MessageDAO extends BaseDao {

  public Long insert(MessageDO message) {
    super.insert("MessageMapper.insert", message);
    return message.getId();
  }

  public int update(MessageDO message) {
    return super.update("MessageMapper.update", message);
  }
  
  public int delete(Long  id){
    return super.delete("MessageMapper.delete", id) ;
  }

  public List<MessageDO> query(MessageQuery query) {
    return super.selectList("MessageMapper.query", query);
  }

  public Integer queryCount(MessageQuery query) {
    Object obj = super.selectOneObject("MessageMapper.queryCount", query);
    return obj == null ? 0 : (Integer) obj;
  }

  public MessageDO load(Long id) {
    Object obj = super.selectOneObject("MessageMapper.load", id);
    return obj == null ? null : (MessageDO) obj;
  }
 
  
}
